package cg.client.gui;

import cg.common.GameFinishedMessage;
import cg.common.UserAction;
import cg.common.UserMessage;
import cg.server.game.Farbkarte;
import cg.server.game.Spielstand;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;

/**
 * @param Diese Klasse beschreibt das GUI für das Spielfeld
 * @author Sebastian Salvisberg
 * @version 1.0
 */

public class GUImain extends javax.swing.JFrame implements Runnable {

    JButton[][] buttons;
    JLabel[][] labels;
    private ObjectOutputStream outstream;
    private ObjectInputStream instream;
    Spielstand spielStand;

    
    public GUImain() {
        initComponents();

        buttons = new JButton[4][3];
        assignButtons();
        labels = new JLabel[4][9];
        assignLabels();
    }


    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPContent = new javax.swing.JPanel();
        jPanelOM = new javax.swing.JPanel();
        jLSpieler1 = new javax.swing.JLabel();
        jLName1 = new javax.swing.JLabel();
        jLPunkte1 = new javax.swing.JLabel();
        jLPunktestand1 = new javax.swing.JLabel();
        jBOrange1 = new javax.swing.JButton();
        jBBraun1 = new javax.swing.JButton();
        jBGruen1 = new javax.swing.JButton();
        jBGelb1 = new javax.swing.JButton();
        jBBlau1 = new javax.swing.JButton();
        jBRosa1 = new javax.swing.JButton();
        jBGrau1 = new javax.swing.JButton();
        jLOrange1 = new javax.swing.JLabel();
        jLBraun1 = new javax.swing.JLabel();
        jLGruen1 = new javax.swing.JLabel();
        jLGelb1 = new javax.swing.JLabel();
        jLBlau1 = new javax.swing.JLabel();
        jLRosa1 = new javax.swing.JLabel();
        jLGrau1 = new javax.swing.JLabel();
        jPanelMR = new javax.swing.JPanel();
        jLSpieler2 = new javax.swing.JLabel();
        jLName2 = new javax.swing.JLabel();
        jLPunkte2 = new javax.swing.JLabel();
        jLPunktestand2 = new javax.swing.JLabel();
        jPGelb5 = new javax.swing.JPanel();
        jPBlau5 = new javax.swing.JPanel();
        jPPink5 = new javax.swing.JPanel();
        jBOrange2 = new javax.swing.JButton();
        jLOrange2 = new javax.swing.JLabel();
        jBBraun2 = new javax.swing.JButton();
        jLBraun2 = new javax.swing.JLabel();
        jBGruen2 = new javax.swing.JButton();
        jLGruen2 = new javax.swing.JLabel();
        jBGelb2 = new javax.swing.JButton();
        jLGelb2 = new javax.swing.JLabel();
        jBBlau2 = new javax.swing.JButton();
        jLBlau2 = new javax.swing.JLabel();
        jBRosa2 = new javax.swing.JButton();
        jLRosa2 = new javax.swing.JLabel();
        jBGrau2 = new javax.swing.JButton();
        jLGrau2 = new javax.swing.JLabel();
        jPanelUM = new javax.swing.JPanel();
        jLSpieler3 = new javax.swing.JLabel();
        jLName3 = new javax.swing.JLabel();
        jLPunkte3 = new javax.swing.JLabel();
        jLPunktestand3 = new javax.swing.JLabel();
        jBOrange3 = new javax.swing.JButton();
        jBBraun3 = new javax.swing.JButton();
        jBGruen3 = new javax.swing.JButton();
        jBGelb3 = new javax.swing.JButton();
        jBBlau3 = new javax.swing.JButton();
        jBRosa3 = new javax.swing.JButton();
        jBGrau3 = new javax.swing.JButton();
        jLOrange3 = new javax.swing.JLabel();
        jLBraun3 = new javax.swing.JLabel();
        jLGruen3 = new javax.swing.JLabel();
        jLGelb3 = new javax.swing.JLabel();
        jLBlau3 = new javax.swing.JLabel();
        jLRosa3 = new javax.swing.JLabel();
        jLGrau3 = new javax.swing.JLabel();
        jPanelML = new javax.swing.JPanel();
        jLSpieler4 = new javax.swing.JLabel();
        jLName4 = new javax.swing.JLabel();
        jLPunkte4 = new javax.swing.JLabel();
        jLPunktestand4 = new javax.swing.JLabel();
        jPGelb4 = new javax.swing.JPanel();
        jPBlau4 = new javax.swing.JPanel();
        jPPink4 = new javax.swing.JPanel();
        jBOrange4 = new javax.swing.JButton();
        jLOrange4 = new javax.swing.JLabel();
        jBBraun4 = new javax.swing.JButton();
        jLBraun4 = new javax.swing.JLabel();
        jBGruen4 = new javax.swing.JButton();
        jLGruen4 = new javax.swing.JLabel();
        jBGelb4 = new javax.swing.JButton();
        jLGelb4 = new javax.swing.JLabel();
        jLBlau4 = new javax.swing.JLabel();
        jBBlau4 = new javax.swing.JButton();
        jBRosa4 = new javax.swing.JButton();
        jLRosa4 = new javax.swing.JLabel();
        jBGrau4 = new javax.swing.JButton();
        jLGrau4 = new javax.swing.JLabel();
        jPanelMM = new javax.swing.JPanel();
        jBZeigStapelKarte = new javax.swing.JButton();
        jBGetR1 = new javax.swing.JButton();
        jBGetR2 = new javax.swing.JButton();
        jBGetR3 = new javax.swing.JButton();
        jBGetR4 = new javax.swing.JButton();
        jB11 = new javax.swing.JButton();
        jB12 = new javax.swing.JButton();
        jB13 = new javax.swing.JButton();
        jB21 = new javax.swing.JButton();
        jB22 = new javax.swing.JButton();
        jB23 = new javax.swing.JButton();
        jB31 = new javax.swing.JButton();
        jB32 = new javax.swing.JButton();
        jB33 = new javax.swing.JButton();
        jB41 = new javax.swing.JButton();
        jB42 = new javax.swing.JButton();
        jB43 = new javax.swing.JButton();
        jBStapelKarteGezeigt = new javax.swing.JButton();
        jBLetzteRundeKarte = new javax.swing.JButton();
        jBWertungskarte = new javax.swing.JButton();
        jLWertungstabelle = new javax.swing.JLabel();
        jBHighscore = new javax.swing.JButton();
        jBColoretto = new javax.swing.JButton();
        jLColorettoDummy = new javax.swing.JLabel();
        jLCopyright = new javax.swing.JLabel();
        jLFHNW = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("COLORETTO - SPIELOBERFLÄCHE");
        setBackground(new java.awt.Color(0, 0, 0));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                GUImain.this.windowOpened(evt);
            }
        });

        jPContent.setBackground(new java.awt.Color(102, 204, 0));

        jPanelOM.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLSpieler1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLSpieler1.setText("Spieler 1");

        jLName1.setText("Name1");

        jLPunkte1.setText("Punkte");

        jLPunktestand1.setText("0");

        jBOrange1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/orange.png"))); // NOI18N
        jBOrange1.setActionCommand("Orange");
        jBOrange1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP1CardClick(evt);
            }
        });

        jBBraun1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/braun.png"))); // NOI18N
        jBBraun1.setActionCommand("Braun");
        jBBraun1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP1CardClick(evt);
            }
        });

        jBGruen1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/gruen.png"))); // NOI18N
        jBGruen1.setActionCommand("Gruen");
        jBGruen1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP1CardClick(evt);
            }
        });

        jBGelb1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/gelb.png"))); // NOI18N
        jBGelb1.setActionCommand("Gelb");
        jBGelb1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP1CardClick(evt);
            }
        });

        jBBlau1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/blau.png"))); // NOI18N
        jBBlau1.setActionCommand("Blau");
        jBBlau1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP1CardClick(evt);
            }
        });

        jBRosa1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/rosa.png"))); // NOI18N
        jBRosa1.setActionCommand("Rosa");
        jBRosa1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP1CardClick(evt);
            }
        });

        jBGrau1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/grau.png"))); // NOI18N
        jBGrau1.setActionCommand("Grau");
        jBGrau1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP1CardClick(evt);
            }
        });

        jLOrange1.setText("0");

        jLBraun1.setText("0");

        jLGruen1.setText("0");

        jLGelb1.setText("0");

        jLBlau1.setText("0");

        jLRosa1.setText("0");

        jLGrau1.setText("0");

        javax.swing.GroupLayout jPanelOMLayout = new javax.swing.GroupLayout(jPanelOM);
        jPanelOM.setLayout(jPanelOMLayout);
        jPanelOMLayout.setHorizontalGroup(
            jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelOMLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLSpieler1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLName1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLPunkte1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLPunktestand1, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBOrange1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLOrange1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBBraun1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLBraun1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBGruen1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLGruen1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBGelb1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLGelb1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBBlau1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLBlau1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBRosa1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLRosa1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBGrau1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLGrau1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(12, Short.MAX_VALUE))
        );
        jPanelOMLayout.setVerticalGroup(
            jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelOMLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanelOMLayout.createSequentialGroup()
                        .addComponent(jLSpieler1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLName1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLPunkte1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jBBraun1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBOrange1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBGruen1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBGelb1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBBlau1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBRosa1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBGrau1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelOMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLPunktestand1)
                    .addComponent(jLOrange1)
                    .addComponent(jLBraun1)
                    .addComponent(jLGruen1)
                    .addComponent(jLGelb1)
                    .addComponent(jLBlau1)
                    .addComponent(jLRosa1)
                    .addComponent(jLGrau1))
                .addGap(21, 21, 21))
        );

        jPanelMR.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLSpieler2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLSpieler2.setText("Spieler 2");

        jLName2.setText("Name2");

        jLPunkte2.setText("Punkte");

        jLPunktestand2.setText("0");

        jPGelb5.setBackground(new java.awt.Color(255, 255, 0));

        javax.swing.GroupLayout jPGelb5Layout = new javax.swing.GroupLayout(jPGelb5);
        jPGelb5.setLayout(jPGelb5Layout);
        jPGelb5Layout.setHorizontalGroup(
            jPGelb5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jPGelb5Layout.setVerticalGroup(
            jPGelb5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 33, Short.MAX_VALUE)
        );

        jPBlau5.setBackground(new java.awt.Color(51, 51, 255));

        javax.swing.GroupLayout jPBlau5Layout = new javax.swing.GroupLayout(jPBlau5);
        jPBlau5.setLayout(jPBlau5Layout);
        jPBlau5Layout.setHorizontalGroup(
            jPBlau5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jPBlau5Layout.setVerticalGroup(
            jPBlau5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 32, Short.MAX_VALUE)
        );

        jPPink5.setBackground(new java.awt.Color(255, 0, 255));

        javax.swing.GroupLayout jPPink5Layout = new javax.swing.GroupLayout(jPPink5);
        jPPink5.setLayout(jPPink5Layout);
        jPPink5Layout.setHorizontalGroup(
            jPPink5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jPPink5Layout.setVerticalGroup(
            jPPink5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 31, Short.MAX_VALUE)
        );

        jBOrange2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/orange.png"))); // NOI18N
        jBOrange2.setActionCommand("Orange");
        jBOrange2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP2CardClick(evt);
            }
        });

        jLOrange2.setText("0");

        jBBraun2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/braun.png"))); // NOI18N
        jBBraun2.setActionCommand("Braun");
        jBBraun2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP2CardClick(evt);
            }
        });

        jLBraun2.setText("0");

        jBGruen2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/gruen.png"))); // NOI18N
        jBGruen2.setActionCommand("Gruen");
        jBGruen2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP2CardClick(evt);
            }
        });

        jLGruen2.setText("0");

        jBGelb2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/gelb.png"))); // NOI18N
        jBGelb2.setActionCommand("Gelb");
        jBGelb2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP2CardClick(evt);
            }
        });

        jLGelb2.setText("0");

        jBBlau2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/blau.png"))); // NOI18N
        jBBlau2.setActionCommand("Blau");
        jBBlau2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP2CardClick(evt);
            }
        });

        jLBlau2.setText("0");

        jBRosa2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/rosa.png"))); // NOI18N
        jBRosa2.setActionCommand("Rosa");
        jBRosa2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP2CardClick(evt);
            }
        });

        jLRosa2.setText("0");

        jBGrau2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/grau.png"))); // NOI18N
        jBGrau2.setActionCommand("Grau");
        jBGrau2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP2CardClick(evt);
            }
        });

        jLGrau2.setText("0");

        javax.swing.GroupLayout jPanelMRLayout = new javax.swing.GroupLayout(jPanelMR);
        jPanelMR.setLayout(jPanelMRLayout);
        jPanelMRLayout.setHorizontalGroup(
            jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMRLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelMRLayout.createSequentialGroup()
                        .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLSpieler2, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE)
                            .addComponent(jLPunkte2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLName2, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLPunktestand2, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelMRLayout.createSequentialGroup()
                        .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelMRLayout.createSequentialGroup()
                                .addComponent(jLOrange2, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLBraun2, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLGruen2, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLGelb2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanelMRLayout.createSequentialGroup()
                                .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanelMRLayout.createSequentialGroup()
                                        .addComponent(jBBlau2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jBRosa2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanelMRLayout.createSequentialGroup()
                                        .addComponent(jLBlau2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLRosa2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jBGrau2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLGrau2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jPPink5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPBlau5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPGelb5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanelMRLayout.createSequentialGroup()
                        .addComponent(jBOrange2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jBBraun2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jBGruen2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jBGelb2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanelMRLayout.setVerticalGroup(
            jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMRLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jBGelb2)
                    .addGroup(jPanelMRLayout.createSequentialGroup()
                        .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLSpieler2)
                            .addComponent(jLName2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelMRLayout.createSequentialGroup()
                                .addComponent(jLPunkte2)
                                .addGap(11, 11, 11))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelMRLayout.createSequentialGroup()
                                .addComponent(jLPunktestand2)
                                .addGap(18, 18, 18)))
                        .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jBOrange2, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jBBraun2, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jBGruen2, javax.swing.GroupLayout.Alignment.TRAILING))))
                .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelMRLayout.createSequentialGroup()
                        .addGap(0, 27, Short.MAX_VALUE)
                        .addComponent(jPGelb5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, 0)
                        .addComponent(jPBlau5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPPink5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(49, 49, 49))
                    .addGroup(jPanelMRLayout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLOrange2)
                            .addComponent(jLGelb2)
                            .addComponent(jLGruen2)
                            .addComponent(jLBraun2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jBGrau2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jBRosa2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jBBlau2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelMRLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLBlau2)
                            .addComponent(jLRosa2)
                            .addComponent(jLGrau2))
                        .addGap(58, 58, 58))))
        );

        jPanelUM.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLSpieler3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLSpieler3.setText("Spieler 3");

        jLName3.setText("Name3");

        jLPunkte3.setText("Punkte");

        jLPunktestand3.setText("0");

        jBOrange3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/orange.png"))); // NOI18N
        jBOrange3.setActionCommand("Orange");
        jBOrange3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP3CardClick(evt);
            }
        });

        jBBraun3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/braun.png"))); // NOI18N
        jBBraun3.setActionCommand("Braun");
        jBBraun3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP3CardClick(evt);
            }
        });

        jBGruen3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/gruen.png"))); // NOI18N
        jBGruen3.setActionCommand("Gruen");
        jBGruen3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP3CardClick(evt);
            }
        });

        jBGelb3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/gelb.png"))); // NOI18N
        jBGelb3.setActionCommand("Gelb");
        jBGelb3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP3CardClick(evt);
            }
        });

        jBBlau3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/blau.png"))); // NOI18N
        jBBlau3.setActionCommand("Blau");
        jBBlau3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP3CardClick(evt);
            }
        });

        jBRosa3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/rosa.png"))); // NOI18N
        jBRosa3.setActionCommand("Rosa");
        jBRosa3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP3CardClick(evt);
            }
        });

        jBGrau3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/grau.png"))); // NOI18N
        jBGrau3.setActionCommand("Grau");
        jBGrau3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP3CardClick(evt);
            }
        });

        jLOrange3.setText("0");

        jLBraun3.setText("0");

        jLGruen3.setText("0");

        jLGelb3.setText("0");

        jLBlau3.setText("0");

        jLRosa3.setText("0");

        jLGrau3.setText("0");

        javax.swing.GroupLayout jPanelUMLayout = new javax.swing.GroupLayout(jPanelUM);
        jPanelUM.setLayout(jPanelUMLayout);
        jPanelUMLayout.setHorizontalGroup(
            jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelUMLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLSpieler3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLName3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLPunkte3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLPunktestand3, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBOrange3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLOrange3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBBraun3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLBraun3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBGruen3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLGruen3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBGelb3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLGelb3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBBlau3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLBlau3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBRosa3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLRosa3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBGrau3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLGrau3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(12, Short.MAX_VALUE))
        );
        jPanelUMLayout.setVerticalGroup(
            jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelUMLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanelUMLayout.createSequentialGroup()
                        .addComponent(jLSpieler3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLName3, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLPunkte3, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jBGrau3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBRosa3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBBlau3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBGelb3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBGruen3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBBraun3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBOrange3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLBraun3)
                        .addComponent(jLGruen3)
                        .addComponent(jLGelb3)
                        .addComponent(jLBlau3)
                        .addComponent(jLRosa3)
                        .addComponent(jLGrau3))
                    .addGroup(jPanelUMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLPunktestand3)
                        .addComponent(jLOrange3)))
                .addContainerGap(30, Short.MAX_VALUE))
        );

        jPanelML.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLSpieler4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLSpieler4.setText("Spieler 4");

        jLName4.setText("Name4");

        jLPunkte4.setText("Punkte");

        jLPunktestand4.setText("0");

        jPGelb4.setBackground(new java.awt.Color(255, 255, 0));

        javax.swing.GroupLayout jPGelb4Layout = new javax.swing.GroupLayout(jPGelb4);
        jPGelb4.setLayout(jPGelb4Layout);
        jPGelb4Layout.setHorizontalGroup(
            jPGelb4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jPGelb4Layout.setVerticalGroup(
            jPGelb4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 33, Short.MAX_VALUE)
        );

        jPBlau4.setBackground(new java.awt.Color(51, 51, 255));

        javax.swing.GroupLayout jPBlau4Layout = new javax.swing.GroupLayout(jPBlau4);
        jPBlau4.setLayout(jPBlau4Layout);
        jPBlau4Layout.setHorizontalGroup(
            jPBlau4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jPBlau4Layout.setVerticalGroup(
            jPBlau4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 32, Short.MAX_VALUE)
        );

        jPPink4.setBackground(new java.awt.Color(255, 0, 255));

        javax.swing.GroupLayout jPPink4Layout = new javax.swing.GroupLayout(jPPink4);
        jPPink4.setLayout(jPPink4Layout);
        jPPink4Layout.setHorizontalGroup(
            jPPink4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jPPink4Layout.setVerticalGroup(
            jPPink4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 31, Short.MAX_VALUE)
        );

        jBOrange4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/orange.png"))); // NOI18N
        jBOrange4.setActionCommand("Orange");
        jBOrange4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP4CardClick(evt);
            }
        });

        jLOrange4.setText("0");

        jBBraun4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/braun.png"))); // NOI18N
        jBBraun4.setActionCommand("Braun");
        jBBraun4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP4CardClick(evt);
            }
        });

        jLBraun4.setText("0");

        jBGruen4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/gruen.png"))); // NOI18N
        jBGruen4.setActionCommand("Gruen");
        jBGruen4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP4CardClick(evt);
            }
        });

        jLGruen4.setText("0");

        jBGelb4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/gelb.png"))); // NOI18N
        jBGelb4.setActionCommand("Gelb");
        jBGelb4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP4CardClick(evt);
            }
        });

        jLGelb4.setText("0");

        jLBlau4.setText("0");

        jBBlau4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/blau.png"))); // NOI18N
        jBBlau4.setActionCommand("Blau");
        jBBlau4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP4CardClick(evt);
            }
        });

        jBRosa4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/rosa.png"))); // NOI18N
        jBRosa4.setActionCommand("Rosa");
        jBRosa4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP4CardClick(evt);
            }
        });

        jLRosa4.setText("0");

        jBGrau4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/grau.png"))); // NOI18N
        jBGrau4.setActionCommand("Grau");
        jBGrau4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jP4CardClick(evt);
            }
        });

        jLGrau4.setText("0");

        javax.swing.GroupLayout jPanelMLLayout = new javax.swing.GroupLayout(jPanelML);
        jPanelML.setLayout(jPanelMLLayout);
        jPanelMLLayout.setHorizontalGroup(
            jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMLLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelMLLayout.createSequentialGroup()
                        .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLSpieler4, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE)
                            .addComponent(jLPunkte4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLName4, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLPunktestand4, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelMLLayout.createSequentialGroup()
                        .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelMLLayout.createSequentialGroup()
                                .addComponent(jLOrange4, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLBraun4, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLGruen4, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLGelb4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanelMLLayout.createSequentialGroup()
                                .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanelMLLayout.createSequentialGroup()
                                        .addComponent(jBBlau4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jBRosa4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanelMLLayout.createSequentialGroup()
                                        .addComponent(jLBlau4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLRosa4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jBGrau4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLGrau4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jPPink4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPBlau4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPGelb4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanelMLLayout.createSequentialGroup()
                        .addComponent(jBOrange4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jBBraun4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jBGruen4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jBGelb4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanelMLLayout.setVerticalGroup(
            jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMLLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jBGelb4)
                    .addGroup(jPanelMLLayout.createSequentialGroup()
                        .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLSpieler4)
                            .addComponent(jLName4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelMLLayout.createSequentialGroup()
                                .addComponent(jLPunkte4)
                                .addGap(11, 11, 11))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelMLLayout.createSequentialGroup()
                                .addComponent(jLPunktestand4)
                                .addGap(18, 18, 18)))
                        .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jBOrange4, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jBBraun4, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jBGruen4, javax.swing.GroupLayout.Alignment.TRAILING))))
                .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelMLLayout.createSequentialGroup()
                        .addGap(0, 27, Short.MAX_VALUE)
                        .addComponent(jPGelb4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, 0)
                        .addComponent(jPBlau4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPPink4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(49, 49, 49))
                    .addGroup(jPanelMLLayout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLOrange4)
                            .addComponent(jLGelb4)
                            .addComponent(jLGruen4)
                            .addComponent(jLBraun4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jBGrau4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jBRosa4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jBBlau4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelMLLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLBlau4)
                            .addComponent(jLRosa4)
                            .addComponent(jLGrau4))
                        .addGap(58, 58, 58))))
        );

        jPanelMM.setBackground(new java.awt.Color(255, 255, 255));
        jPanelMM.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanelMM.setToolTipText("");
        jPanelMM.setInheritsPopupMenu(true);

        jBZeigStapelKarte.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/deck.png"))); // NOI18N
        jBZeigStapelKarte.setActionCommand("StapelKarte");
        jBZeigStapelKarte.setMaximumSize(new java.awt.Dimension(61, 41));
        jBZeigStapelKarte.setMinimumSize(new java.awt.Dimension(61, 41));
        jBZeigStapelKarte.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBZeigStapelKarteActionPerformed(evt);
            }
        });

        jBGetR1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/reihe.png"))); // NOI18N
        jBGetR1.setActionCommand("1");
        jBGetR1.setMaximumSize(new java.awt.Dimension(61, 41));
        jBGetR1.setMinimumSize(new java.awt.Dimension(61, 41));
        jBGetR1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMitteCardClick(evt);
            }
        });

        jBGetR2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/reihe.png"))); // NOI18N
        jBGetR2.setActionCommand("2");
        jBGetR2.setMaximumSize(new java.awt.Dimension(61, 41));
        jBGetR2.setMinimumSize(new java.awt.Dimension(61, 41));
        jBGetR2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMitteCardClick(evt);
            }
        });

        jBGetR3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/reihe.png"))); // NOI18N
        jBGetR3.setActionCommand("3");
        jBGetR3.setMaximumSize(new java.awt.Dimension(61, 41));
        jBGetR3.setMinimumSize(new java.awt.Dimension(61, 41));
        jBGetR3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMitteCardClick(evt);
            }
        });

        jBGetR4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/reihe.png"))); // NOI18N
        jBGetR4.setActionCommand("4");
        jBGetR4.setMaximumSize(new java.awt.Dimension(61, 41));
        jBGetR4.setMinimumSize(new java.awt.Dimension(61, 41));
        jBGetR4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMitteCardClick(evt);
            }
        });

        jB11.setMaximumSize(new java.awt.Dimension(61, 41));
        jB11.setMinimumSize(new java.awt.Dimension(61, 41));

        jB12.setMaximumSize(new java.awt.Dimension(61, 41));
        jB12.setMinimumSize(new java.awt.Dimension(61, 41));

        jB13.setMaximumSize(new java.awt.Dimension(61, 41));
        jB13.setMinimumSize(new java.awt.Dimension(61, 41));

        jB21.setMaximumSize(new java.awt.Dimension(61, 41));
        jB21.setMinimumSize(new java.awt.Dimension(61, 41));

        jB22.setMaximumSize(new java.awt.Dimension(61, 41));
        jB22.setMinimumSize(new java.awt.Dimension(61, 41));

        jB23.setMaximumSize(new java.awt.Dimension(61, 41));
        jB23.setMinimumSize(new java.awt.Dimension(61, 41));

        jB31.setMaximumSize(new java.awt.Dimension(61, 41));
        jB31.setMinimumSize(new java.awt.Dimension(61, 41));

        jB32.setMaximumSize(new java.awt.Dimension(61, 41));
        jB32.setMinimumSize(new java.awt.Dimension(61, 41));

        jB33.setMaximumSize(new java.awt.Dimension(61, 41));
        jB33.setMinimumSize(new java.awt.Dimension(61, 41));

        jB41.setMaximumSize(new java.awt.Dimension(61, 41));
        jB41.setMinimumSize(new java.awt.Dimension(61, 41));

        jB42.setMaximumSize(new java.awt.Dimension(61, 41));
        jB42.setMinimumSize(new java.awt.Dimension(61, 41));

        jB43.setMaximumSize(new java.awt.Dimension(61, 41));
        jB43.setMinimumSize(new java.awt.Dimension(61, 41));

        jBStapelKarteGezeigt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/grau.png"))); // NOI18N
        jBStapelKarteGezeigt.setMaximumSize(new java.awt.Dimension(61, 41));
        jBStapelKarteGezeigt.setMinimumSize(new java.awt.Dimension(61, 41));
        jBStapelKarteGezeigt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBStapelKarteGezeigtActionPerformed(evt);
            }
        });

        jBLetzteRundeKarte.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/pfeil.png")));
        jBLetzteRundeKarte.setMaximumSize(new java.awt.Dimension(61, 41));
        jBLetzteRundeKarte.setMinimumSize(new java.awt.Dimension(61, 41));
        jBLetzteRundeKarte.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBLetzteRundeKarteActionPerformed(evt);
            }
        });

        jBWertungskarte.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/wertung.png"))); // NOI18N

        jLWertungstabelle.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        jLWertungstabelle.setText("Wertungstabelle:");

        javax.swing.GroupLayout jPanelMMLayout = new javax.swing.GroupLayout(jPanelMM);
        jPanelMM.setLayout(jPanelMMLayout);
        jPanelMMLayout.setHorizontalGroup(
            jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMMLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jBZeigStapelKarte, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBStapelKarteGezeigt, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBLetzteRundeKarte, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(63, 63, 63)
                .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jBGetR4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBGetR3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jBGetR1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jBGetR2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelMMLayout.createSequentialGroup()
                        .addComponent(jB41, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jB42, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jB43, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanelMMLayout.createSequentialGroup()
                        .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelMMLayout.createSequentialGroup()
                                .addComponent(jB11, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jB12, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jB13, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanelMMLayout.createSequentialGroup()
                                .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(jPanelMMLayout.createSequentialGroup()
                                        .addComponent(jB31, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jB32, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanelMMLayout.createSequentialGroup()
                                        .addComponent(jB21, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jB22, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jB23, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jB33, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jBWertungskarte, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLWertungstabelle, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        jPanelMMLayout.setVerticalGroup(
            jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMMLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jBZeigStapelKarte, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jBGetR1, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jB11, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jB12, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jB13, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLWertungstabelle))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanelMMLayout.createSequentialGroup()
                        .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jBGetR2, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jB21, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jB22, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jB23, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jBStapelKarteGezeigt, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jBGetR3, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jB31, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jB33, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jB32, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jBWertungskarte, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelMMLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jB42, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBGetR4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jB41, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jB43, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBLetzteRundeKarte, javax.swing.GroupLayout.DEFAULT_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jBHighscore.setText("Highscore");
        jBHighscore.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBHighscoreActionPerformed(evt);
            }
        });

        jBColoretto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/coloretto.jpg"))); // NOI18N

        jLColorettoDummy.setFont(new java.awt.Font("Calibri", 1, 29)); // NOI18N
        jLColorettoDummy.setText("DUMMY");

        jLCopyright.setFont(new java.awt.Font("Tahoma", 0, 8)); // NOI18N
        jLCopyright.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLCopyright.setText("© Copyright by Tim Beer, Yanick Belart, Christian Friedli, Sebastian Salvisberg ");

        jLFHNW.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/nw.png"))); // NOI18N

        javax.swing.GroupLayout jPContentLayout = new javax.swing.GroupLayout(jPContent);
        jPContent.setLayout(jPContentLayout);
        jPContentLayout.setHorizontalGroup(
            jPContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPContentLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPContentLayout.createSequentialGroup()
                        .addGroup(jPContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPContentLayout.createSequentialGroup()
                                .addComponent(jLCopyright, javax.swing.GroupLayout.PREFERRED_SIZE, 450, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(16, 16, 16))
                            .addGroup(jPContentLayout.createSequentialGroup()
                                .addComponent(jBColoretto, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jBHighscore, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLColorettoDummy, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(482, 482, 482)))
                        .addComponent(jLFHNW, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPContentLayout.createSequentialGroup()
                        .addGroup(jPContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jPanelOM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPContentLayout.createSequentialGroup()
                                .addComponent(jPanelML, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jPanelUM, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanelMM, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanelMR, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(18, Short.MAX_VALUE))
        );
        jPContentLayout.setVerticalGroup(
            jPContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPContentLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanelOM, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPContentLayout.createSequentialGroup()
                        .addComponent(jLColorettoDummy, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jBHighscore))
                    .addComponent(jBColoretto, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(jLFHNW))
                .addGap(12, 12, 12)
                .addGroup(jPContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPContentLayout.createSequentialGroup()
                        .addGroup(jPContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanelMM, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanelMR, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanelUM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLCopyright, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPContentLayout.createSequentialGroup()
                        .addComponent(jPanelML, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPContent, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPContent, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBZeigStapelKarteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBZeigStapelKarteActionPerformed
        if (spielStand.stapelkarteGezogen == false) {
            SendAction(new UserAction(UserAction.UserActionMode.StapelKarte, evt.getActionCommand()));
        }
    }//GEN-LAST:event_jBZeigStapelKarteActionPerformed

    private void windowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_windowOpened

        final GUImain hlp = this;
        final GUIstart gs = new GUIstart();
        gs.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        gs.addWindowListener(new WindowAdapter() {

            @Override
            public void windowDeactivated(WindowEvent e) {
                super.windowDeactivated(e);
                instream = gs.getInstream();
                outstream = gs.getOutstream();
                if (instream != null && outstream != null) {
                    new Thread(hlp).start();
                }
            }
        });
        gs.setVisible(true);        // TODO add your handling code here:
    }//GEN-LAST:event_windowOpened

    private void jP1CardClick(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jP1CardClick
        //no event
    }//GEN-LAST:event_jP1CardClick

    private void jP2CardClick(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jP2CardClick
        //no event
    }//GEN-LAST:event_jP2CardClick

    private void jP4CardClick(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jP4CardClick
        //no event
    }//GEN-LAST:event_jP4CardClick

    private void jMitteCardClick(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMitteCardClick
        SendAction(new UserAction(UserAction.UserActionMode.ReiheAufnehmen, evt.getActionCommand()));
    }//GEN-LAST:event_jMitteCardClick

    private void jP3CardClick(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jP3CardClick
        //no event
    }//GEN-LAST:event_jP3CardClick

    private void jBStapelKarteGezeigtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBStapelKarteGezeigtActionPerformed
        //no event
    }//GEN-LAST:event_jBStapelKarteGezeigtActionPerformed

    private void jBLetzteRundeKarteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBLetzteRundeKarteActionPerformed
        //no event
    }//GEN-LAST:event_jBLetzteRundeKarteActionPerformed

    private void jBHighscoreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBHighscoreActionPerformed
        GUIhighscore highscore = new GUIhighscore();
        highscore.setVisible(true);
    }//GEN-LAST:event_jBHighscoreActionPerformed

    private void SendAction(UserAction ua) {
        try {
            outstream.writeObject(ua);
        } catch (IOException ex) {

            Logger.getLogger(GUImain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jB11;
    private javax.swing.JButton jB12;
    private javax.swing.JButton jB13;
    private javax.swing.JButton jB21;
    private javax.swing.JButton jB22;
    private javax.swing.JButton jB23;
    private javax.swing.JButton jB31;
    private javax.swing.JButton jB32;
    private javax.swing.JButton jB33;
    private javax.swing.JButton jB41;
    private javax.swing.JButton jB42;
    private javax.swing.JButton jB43;
    private javax.swing.JButton jBBlau1;
    private javax.swing.JButton jBBlau2;
    private javax.swing.JButton jBBlau3;
    private javax.swing.JButton jBBlau4;
    private javax.swing.JButton jBBraun1;
    private javax.swing.JButton jBBraun2;
    private javax.swing.JButton jBBraun3;
    private javax.swing.JButton jBBraun4;
    private javax.swing.JButton jBColoretto;
    private javax.swing.JButton jBGelb1;
    private javax.swing.JButton jBGelb2;
    private javax.swing.JButton jBGelb3;
    private javax.swing.JButton jBGelb4;
    private javax.swing.JButton jBGetR1;
    private javax.swing.JButton jBGetR2;
    private javax.swing.JButton jBGetR3;
    private javax.swing.JButton jBGetR4;
    private javax.swing.JButton jBGrau1;
    private javax.swing.JButton jBGrau2;
    private javax.swing.JButton jBGrau3;
    private javax.swing.JButton jBGrau4;
    private javax.swing.JButton jBGruen1;
    private javax.swing.JButton jBGruen2;
    private javax.swing.JButton jBGruen3;
    private javax.swing.JButton jBGruen4;
    private javax.swing.JButton jBHighscore;
    private javax.swing.JButton jBLetzteRundeKarte;
    private javax.swing.JButton jBOrange1;
    private javax.swing.JButton jBOrange2;
    private javax.swing.JButton jBOrange3;
    private javax.swing.JButton jBOrange4;
    private javax.swing.JButton jBRosa1;
    private javax.swing.JButton jBRosa2;
    private javax.swing.JButton jBRosa3;
    private javax.swing.JButton jBRosa4;
    private javax.swing.JButton jBStapelKarteGezeigt;
    private javax.swing.JButton jBWertungskarte;
    private javax.swing.JButton jBZeigStapelKarte;
    private javax.swing.JLabel jLBlau1;
    private javax.swing.JLabel jLBlau2;
    private javax.swing.JLabel jLBlau3;
    private javax.swing.JLabel jLBlau4;
    private javax.swing.JLabel jLBraun1;
    private javax.swing.JLabel jLBraun2;
    private javax.swing.JLabel jLBraun3;
    private javax.swing.JLabel jLBraun4;
    private javax.swing.JLabel jLColorettoDummy;
    private javax.swing.JLabel jLCopyright;
    private javax.swing.JLabel jLFHNW;
    private javax.swing.JLabel jLGelb1;
    private javax.swing.JLabel jLGelb2;
    private javax.swing.JLabel jLGelb3;
    private javax.swing.JLabel jLGelb4;
    private javax.swing.JLabel jLGrau1;
    private javax.swing.JLabel jLGrau2;
    private javax.swing.JLabel jLGrau3;
    private javax.swing.JLabel jLGrau4;
    private javax.swing.JLabel jLGruen1;
    private javax.swing.JLabel jLGruen2;
    private javax.swing.JLabel jLGruen3;
    private javax.swing.JLabel jLGruen4;
    public javax.swing.JLabel jLName1;
    private javax.swing.JLabel jLName2;
    private javax.swing.JLabel jLName3;
    private javax.swing.JLabel jLName4;
    private javax.swing.JLabel jLOrange1;
    private javax.swing.JLabel jLOrange2;
    private javax.swing.JLabel jLOrange3;
    private javax.swing.JLabel jLOrange4;
    private javax.swing.JLabel jLPunkte1;
    private javax.swing.JLabel jLPunkte2;
    private javax.swing.JLabel jLPunkte3;
    private javax.swing.JLabel jLPunkte4;
    private javax.swing.JLabel jLPunktestand1;
    private javax.swing.JLabel jLPunktestand2;
    private javax.swing.JLabel jLPunktestand3;
    private javax.swing.JLabel jLPunktestand4;
    private javax.swing.JLabel jLRosa1;
    private javax.swing.JLabel jLRosa2;
    private javax.swing.JLabel jLRosa3;
    private javax.swing.JLabel jLRosa4;
    private javax.swing.JLabel jLSpieler1;
    private javax.swing.JLabel jLSpieler2;
    private javax.swing.JLabel jLSpieler3;
    private javax.swing.JLabel jLSpieler4;
    private javax.swing.JLabel jLWertungstabelle;
    private javax.swing.JPanel jPBlau4;
    private javax.swing.JPanel jPBlau5;
    private javax.swing.JPanel jPContent;
    private javax.swing.JPanel jPGelb4;
    private javax.swing.JPanel jPGelb5;
    private javax.swing.JPanel jPPink4;
    private javax.swing.JPanel jPPink5;
    private javax.swing.JPanel jPanelML;
    private javax.swing.JPanel jPanelMM;
    private javax.swing.JPanel jPanelMR;
    private javax.swing.JPanel jPanelOM;
    private javax.swing.JPanel jPanelUM;
    // End of variables declaration//GEN-END:variables

    //Weist die 4x3 Buttons dem Array zu
    private void assignButtons() {
        
        buttons[0][0] = jB11;
        buttons[0][1] = jB12;
        buttons[0][2] = jB13;
        buttons[1][0] = jB21;
        buttons[1][1] = jB22;
        buttons[1][2] = jB23;
        buttons[2][0] = jB31;
        buttons[2][1] = jB32;
        buttons[2][2] = jB33;
        buttons[3][0] = jB41;
        buttons[3][1] = jB42;
        buttons[3][2] = jB43;
    }
    
    private void assignLabels() {
        if (spielStand == null) {
            return;
        }
        if (spielStand.iAmPlayer == 1)
            jLSpieler1.setForeground(Color.red);
        else if (spielStand.iAmPlayer == 2)
            jLSpieler2.setForeground(Color.red);
        else if (spielStand.iAmPlayer == 3)
            jLSpieler3.setForeground(Color.red);
        else if (spielStand.iAmPlayer == 4)
            jLSpieler4.setForeground(Color.red);
        
        //Labels Punkte Spieler 1
        jLOrange1.setText(Integer.toString(spielStand.Spieler1Orange));
        jLBraun1.setText(Integer.toString(spielStand.Spieler1Braun));
        jLGruen1.setText(Integer.toString(spielStand.Spieler1Gruen));
        jLGelb1.setText(Integer.toString(spielStand.Spieler1Gelb));
        jLBlau1.setText(Integer.toString(spielStand.Spieler1Blau));
        jLRosa1.setText(Integer.toString(spielStand.Spieler1Magenta));
        jLGrau1.setText(Integer.toString(spielStand.Spieler1Grau));
        jLPunktestand1.setText(Integer.toString(spielStand.Spieler1Total));
        
        //Labels Punkte Spieler 2
        jLOrange2.setText(Integer.toString(spielStand.Spieler2Orange));
        jLBraun2.setText(Integer.toString(spielStand.Spieler2Braun));
        jLGruen2.setText(Integer.toString(spielStand.Spieler2Gruen));
        jLGelb2.setText(Integer.toString(spielStand.Spieler2Gelb));
        jLBlau2.setText(Integer.toString(spielStand.Spieler2Blau));
        jLRosa2.setText(Integer.toString(spielStand.Spieler2Magenta));
        jLGrau2.setText(Integer.toString(spielStand.Spieler2Grau));
        jLPunktestand2.setText(Integer.toString(spielStand.Spieler2Total));
        
        //Labels Punkte Spieler 3
        jLOrange3.setText(Integer.toString(spielStand.Spieler3Orange));
        jLBraun3.setText(Integer.toString(spielStand.Spieler3Braun));
        jLGruen3.setText(Integer.toString(spielStand.Spieler3Gruen));
        jLGelb3.setText(Integer.toString(spielStand.Spieler3Gelb));
        jLBlau3.setText(Integer.toString(spielStand.Spieler3Blau));
        jLRosa3.setText(Integer.toString(spielStand.Spieler3Magenta));
        jLGrau3.setText(Integer.toString(spielStand.Spieler3Grau));
        jLPunktestand3.setText(Integer.toString(spielStand.Spieler3Total));
        
        //Labels Punkte Spieler 4
        jLOrange4.setText(Integer.toString(spielStand.Spieler4Orange));
        jLBraun4.setText(Integer.toString(spielStand.Spieler4Braun));
        jLGruen4.setText(Integer.toString(spielStand.Spieler4Gruen));
        jLGelb4.setText(Integer.toString(spielStand.Spieler4Gelb));
        jLBlau4.setText(Integer.toString(spielStand.Spieler4Blau));
        jLRosa4.setText(Integer.toString(spielStand.Spieler4Magenta));
        jLGrau4.setText(Integer.toString(spielStand.Spieler4Grau));
        jLPunktestand4.setText(Integer.toString(spielStand.Spieler4Total));
        
        // Ist die Reihe aktiv, werden die Karten angezeigt, ansonsten nicht
        if (spielStand.Reihe1aktiv == true) {
            buttons[0][0].setVisible(true);
            buttons[0][1].setVisible(true);
            buttons[0][2].setVisible(true);
            buttons[0][0].setIcon(GetIconByFarbkarte(spielStand.Reihe11));
            buttons[0][1].setIcon(GetIconByFarbkarte(spielStand.Reihe12));
            buttons[0][2].setIcon(GetIconByFarbkarte(spielStand.Reihe13));
        } else {
            buttons[0][0].setVisible(false);
            buttons[0][1].setVisible(false);
            buttons[0][2].setVisible(false);
        }
        if (spielStand.Reihe2aktiv == true) {
            buttons[1][0].setVisible(true);
            buttons[1][1].setVisible(true);
            buttons[1][2].setVisible(true);
            buttons[1][0].setIcon(GetIconByFarbkarte(spielStand.Reihe21));
            buttons[1][1].setIcon(GetIconByFarbkarte(spielStand.Reihe22));
            buttons[1][2].setIcon(GetIconByFarbkarte(spielStand.Reihe23));
        } else {
            buttons[1][0].setVisible(false);
            buttons[1][1].setVisible(false);
            buttons[1][2].setVisible(false);
        }
        if (spielStand.Reihe3aktiv == true) {
            buttons[2][0].setVisible(true);
            buttons[2][1].setVisible(true);
            buttons[2][2].setVisible(true);
            buttons[2][0].setIcon(GetIconByFarbkarte(spielStand.Reihe31));
            buttons[2][1].setIcon(GetIconByFarbkarte(spielStand.Reihe32));
            buttons[2][2].setIcon(GetIconByFarbkarte(spielStand.Reihe33));
        } else {
            buttons[2][0].setVisible(false);
            buttons[2][1].setVisible(false);
            buttons[2][2].setVisible(false);
        }
        if (spielStand.Reihe4aktiv == true) {
            buttons[3][0].setVisible(true);
            buttons[3][1].setVisible(true);
            buttons[3][2].setVisible(true);
            buttons[3][0].setIcon(GetIconByFarbkarte(spielStand.Reihe41));
            buttons[3][1].setIcon(GetIconByFarbkarte(spielStand.Reihe42));
            buttons[3][2].setIcon(GetIconByFarbkarte(spielStand.Reihe43));
        } else {
            buttons[3][0].setVisible(false);
            buttons[3][1].setVisible(false);
            buttons[3][2].setVisible(false);
        }
        // jBStapelKarteGezeigt.setIcon(GetIconByFarbkarte(spielStand.GezogeneKarte));
        if (spielStand.stapelkarteGezogen == false) {
            jBStapelKarteGezeigt.setVisible(false);
        // jBStapelKarteGezeigt.setIcon(GetIconByFarbkarte(null));
        } else {
            jBStapelKarteGezeigt.setVisible(true);
            jBStapelKarteGezeigt.setIcon(GetIconByFarbkarte(spielStand.GezogeneKarte));
        }
        jBStapelKarteGezeigt.setIcon(GetIconByFarbkarte(spielStand.GezogeneKarte));

        jBZeigStapelKarte.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/deck.png")));

        if (spielStand.letzteRundekarteGezogen == false) {
            jBLetzteRundeKarte.setVisible(false);
        } else {
            jBLetzteRundeKarte.setVisible(true);
            jBLetzteRundeKarte.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cg/client/gui/images/pfeil.png")));
        }

        
        Border borderCurrentPlayer = new LineBorder(Color.RED, 2);
        Border borderNotCurrentPlayer = new LineBorder(Color.GRAY, 1);

        switch (spielStand.currentPlayer) {
            case 1:
                jPanelOM.setBorder(borderCurrentPlayer);
                jPanelMR.setBorder(borderNotCurrentPlayer);
                jPanelUM.setBorder(borderNotCurrentPlayer);
                jPanelML.setBorder(borderNotCurrentPlayer);
                break;
            case 2:
                jPanelOM.setBorder(borderNotCurrentPlayer);
                jPanelMR.setBorder(borderCurrentPlayer);
                jPanelUM.setBorder(borderNotCurrentPlayer);
                jPanelML.setBorder(borderNotCurrentPlayer);
                break;

            case 3:
                jPanelOM.setBorder(borderNotCurrentPlayer);
                jPanelMR.setBorder(borderNotCurrentPlayer);
                jPanelUM.setBorder(borderCurrentPlayer);
                jPanelML.setBorder(borderNotCurrentPlayer);
                break;
            case 4:
                jPanelOM.setBorder(borderNotCurrentPlayer);
                jPanelMR.setBorder(borderNotCurrentPlayer);
                jPanelUM.setBorder(borderNotCurrentPlayer);
                jPanelML.setBorder(borderCurrentPlayer);
                break;
        }
    }

    Icon GetIconByFarbkarte(Farbkarte karte) {
        if (karte == null) {
            return null;
        }

        if ("magenta".equals(karte.getFarbe())) {
            return jBRosa1.getIcon();
        } else if ("orange".equals(karte.getFarbe())) {
            return jBOrange1.getIcon();
        } else if ("blau".equals(karte.getFarbe())) {
            return jBBlau1.getIcon();
        } else if ("braun".equals(karte.getFarbe())) {
            return jBBraun1.getIcon();
        } else if ("gelb".equals(karte.getFarbe())) {
            return jBGelb1.getIcon();
        } else if ("grau".equals(karte.getFarbe())) {
            return jBGrau1.getIcon();
        } else if ("gruen".equals(karte.getFarbe())) {
            return jBGruen1.getIcon();
        }
        return null;
    }

    @Override
    public void run() {
        while (true) {
            try {
                Object obj = instream.readObject();

                if (obj.getClass() == UserMessage.class) {
                    UserMessage mes = (UserMessage) obj;
                    JOptionPane.showMessageDialog(this, mes.getMessageToShow(), "Server Message", mes.getSeverity());
                } else if (obj.getClass() == Spielstand.class) {
                    Spielstand sna = (Spielstand) obj;
                    jLName1.setText(sna.SpielerName1);
                    jLName2.setText(sna.SpielerName2);
                    jLName3.setText(sna.SpielerName3);
                    jLName4.setText(sna.SpielerName4);
                    spielStand = sna;
                    assignLabels();
                } else if (obj.getClass() == GameFinishedMessage.class)
                {
                    GameFinishedMessage fin = (GameFinishedMessage) obj;
                    new GUIend(fin).setVisible(true);
                    this.dispose(); 
                }

                System.out.println("Got Object");
            } catch (IOException ex) {
                Logger.getLogger(GUImain.class.getName()).log(Level.SEVERE, null, ex);
                outstream = null;
                instream = null;
                break;
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(GUImain.class.getName()).log(Level.SEVERE, null, ex);
            } catch (Exception ex) {
            }
        }
    }
}